package com.netease.b.b.c;

import com.netease.b.b.e.f;
import com.netease.b.b.e.g;
import com.netease.b.b.e.k;
import com.netease.framework.a.m;
import com.netease.pris.a.i;
import com.netease.pris.c.l;
import java.io.StringReader;
import org.apache.http.entity.ByteArrayEntity;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserFactory;

public class c extends k
{
  private static final String a = "http://api.douban.com/miniblog/saying";
  private String b;
  private String j;
  private String k;
  private m l;

  protected c(int paramInt)
  {
    super(paramInt);
  }

  public static com.netease.framework.b.a a(String paramString1, String paramString2, String paramString3)
  {
    int i = 4097;
    if (!i.e(paramString3))
      i = 4098;
    c localc = new c(i);
    localc.j = paramString3;
    localc.b = paramString2;
    localc.k = paramString1;
    return localc;
  }

  private void a(String paramString1, String paramString2)
  {
    a.a().a(paramString1, paramString2);
  }

  private boolean a()
  {
    int i = 1;
    String[] arrayOfString = l.c(com.netease.b.a.d.h().a(), this.k, 6);
    if ((arrayOfString != null) && (arrayOfString.length == 2) && (!i.e(arrayOfString[0])) && (!i.e(arrayOfString[i])))
      a(arrayOfString[0], arrayOfString[i]);
    while (true)
    {
      return i;
      i = 0;
    }
  }

  private g b(String paramString)
  {
    g localg = new g(6);
    int i;
    do
      try
      {
        XmlPullParserFactory localXmlPullParserFactory = XmlPullParserFactory.newInstance();
        localXmlPullParserFactory.setNamespaceAware(true);
        XmlPullParser localXmlPullParser = localXmlPullParserFactory.newPullParser();
        localXmlPullParser.setInput(new StringReader(paramString));
        i = localXmlPullParser.getEventType();
        continue;
        while (true)
        {
          i = localXmlPullParser.next();
          break;
          if (!"id".equals(localXmlPullParser.getName()))
            continue;
          localg.a(localXmlPullParser.nextText());
        }
      }
      catch (Exception localException)
      {
        localg = null;
        localException.printStackTrace();
        return localg;
      }
    while (i == 1);
    switch (i)
    {
    case 0:
    case 1:
    default:
    case 2:
    }
  }

  private m b(String paramString1, String paramString2)
  {
    com.netease.f.b localb = new com.netease.f.b("entry");
    localb.b("xmlns:ns0", "http://www.w3.org/2005/Atom");
    localb.b("xmlns:db", "http://www.douban.com/xmlns/");
    localb.f("content").g(paramString1);
    ByteArrayEntity localByteArrayEntity = new ByteArrayEntity(("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + localb.toString()).getBytes());
    com.netease.c.b.c localc = a.a().b().a(com.netease.framework.a.b.b, "http://api.douban.com/miniblog/saying", null, localByteArrayEntity);
    localc.b("Content-Type", "application/atom+xml");
    return localc;
  }

  public void a(int paramInt, String paramString)
  {
    f localf = a.a().a(paramInt, paramString);
    d(localf.h, localf);
  }

  public void a(String paramString)
  {
    Object localObject;
    switch (n())
    {
    default:
      localObject = null;
      if (o())
        break;
      if (localObject != null)
        c(0, localObject);
    case 4097:
    case 4098:
    }
    while (true)
    {
      return;
      localObject = b(paramString);
      break;
      d(-1, null);
    }
  }

  public void c()
  {
    if (!a())
    {
      d(-2, null);
      com.netease.g.b.d("***********", "Error  withou token & secret to send blog");
    }
    while (true)
    {
      return;
      switch (n())
      {
      default:
      case 4097:
      case 4098:
      }
      while (true)
      {
        if ((this.l == null) || (o()))
          break label92;
        a(this.l);
        break;
        this.l = b(this.b, this.j);
      }
      label92: d(-4, null);
      h();
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.b.b.c.c
 * JD-Core Version:    0.6.0
 */